package collection;

public class Entry<K, V> {

	private K key;
	private V value;
	
	public Entry(K key, V value)
	{
		this.key = key;
		this.value = value;
	}
	
	public K getKey()
	{
		return this.key;
	}
	
	public void setKey(K key)
	{
		this.key = key;
	}
	
	public V getValue()
	{
		return this.value;
	}
	
	public void setValue(V value)
	{
		this.value = value;
	}
	
	@Override
	public String toString()
	{
		return "(" + this.key + ", " + this.value + ")";
	}
	
	@Override
	public boolean equals(Object obj)
	{
		return (obj.getClass() == this.getClass() && equals((Entry<K,V>) obj));
	}
	
	public boolean equals(Entry<K,V> other)
	{
		return this.key.equals(other.key) && this.value.equals(other.value);
	}
}
